package com.xiezc;

import com.xiezc.util.TicketInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import javax.annotation.Resource;

/**
 * Created by wb-xzc291800 on 2017/6/22.
 */
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {

    @Resource
    private TicketInterceptor ticketInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(ticketInterceptor)
                .addPathPatterns("/fileInfo/**")
                .addPathPatterns("/upload/**")
                .addPathPatterns("/download/**");
    }
}
